#include <iostream>
#include <cstring>
#include <queue>
#include <cassert>
#include <vector>
#include <cstdio>

const int N = 605;
const int M = 1e6 + 5;
const int INF = 0x3f3f3f3f;

int n, m, q, s, t;
int head[N], nxt[M], to[M], fl[M], cost[M], tot = 1;
int dis[N], from[N];
bool inq[N];

inline void addedge(int u, int v, int f, int c) {
	nxt[++tot] = head[u];
	to[tot] = v;
	fl[tot] = f;
	cost[tot] = c;
	head[u] = tot;
}

bool spfa() {
	memset(dis, 0x3f, sizeof dis);
	std::queue<int> q;
	dis[s] = 0;
	q.push(s);
	while(!q.empty()) {
		int u = q.front(); q.pop();
		inq[u] = 0;
		for(int e = head[u]; e; e = nxt[e]) {
			int v = to[e];
			if(fl[e] && dis[v] > dis[u] + cost[e]) {
				dis[v] = dis[u] + cost[e];
				from[v] = e;
				if(!inq[v]) {
					inq[v] = 1;
					q.push(v);
				}
			}
		}
	}
	return dis[t] != INF;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout.tie(nullptr);

	std::freopen("journey.in", "r", stdin);
	std::freopen("journey.out", "w", stdout);

	std::cin >> n >> m >> q;
	for(int i = 1; i <= m; ++i) {
		int u, v, w; std::cin >> u >> v >> w;
		addedge(u, v + n, INF, w);
		addedge(v + n, u, 0, -w);
	}
	s = 2 * n + 1, t = 2 * n + 2;
	for(int i = 1; i <= n; ++i) {
		addedge(s, i, 1, 0);
		addedge(i, s, 0, 0);
		addedge(i + n, i, INF, 0);
		addedge(i, i + n, 0, 0);
		addedge(i + n, t, 1, 0);
		addedge(t, i + n, 0, 0);
	}
	std::vector<int> dist;
	while(spfa()) {
		dist.push_back(dis[t]);
		int u = t;
		while(u != s) {
			int e = from[u];
			--fl[e], ++fl[e^1];
			u = to[e^1];
		}
	}
	while(dist.size() < n) dist.push_back(INF);
	while(q--) {
		int c; std::cin >> c;
		long long ans = 0;
		for(int x : dist) ans += std::min(x, c);
		std::cout << ans << "\n";
	}

	return 0;
}
